#!/bin/bash

# Android rom build(don't clean cache) shell of Sony Xperia XZ1 Dual G8342.
# Please put this file into the sub directory.
#   e.g: [Your android source code root directory]/[sub directory named 'shell']/sony_poplar_dsds_deploy_shell
# 
# You should change directory and execute some command to build project.
#   e.g: 
#       cd [Your android source code root directory]/[sub directory named 'shell']/sony_poplar_dsds_deploy_shell
#       sh sony_poplar_dsds_build_n_clean.sh
# 
# create by: SteveJrong
# version: 1.0

ROOT_PATH=
getRootPath(){
	ORIGINAL_PATH=$(pwd)
	SUB_PATH=${ORIGINAL_PATH%/*}
	ROOT_PATH=${SUB_PATH%/*}
}
getRootPath

cd $ROOT_PATH

echo -e "··············· source env.\n"
source build/envsetup.sh
echo -e "··············· Done!\n"

echo -e "··············· lunching.\n"
lunch cherish_poplar_dsds-userdebug
echo -e "··············· Done!\n"

echo -e "··············· Compiling.\n"
m -j4 bacon
echo -e "··············· Done!\n"

echo -e "··············· All Done √ \n"